
import time

import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Edge()
driver.maximize_window() #浏览器最大化操作
driver.implicitly_wait(5)
@pytest.mark.parametrize("username,password,verify_code",[("13522221212","123456","8888")])
def test_login(username,password,verify_code):
    driver.get("http://localhost/index.php/Home/user/login.html")
    driver.find_element(By.CSS_SELECTOR,"#username").send_keys(username)
    driver.find_element(By.CSS_SELECTOR,"#password").send_keys(password)
    driver.find_element(By.CSS_SELECTOR,"#verify_code").send_keys(verify_code)
    driver.find_element(By.CSS_SELECTOR,"a[name='sbtbutton']").click()
    # 4 关闭浏览器驱动对象
    time.sleep(30)  #代码暂停10s中
    driver.quit()